<?php if (!defined ('BASEPATH')) exit ('No direct script access allowed');

class Test extends CI_Controller {

	public function __construct(){
		parent::__construct();
		$this->load->model('articles_model');
		$this->load->model('category_model');
		$this->load->model('sitesetting_model');
	}
	
	public function index(){
		$this->info();
		$this->articles_model();
		$this->category_model();
	}
	
	public function goodsClick(){
		echo $this->goods_model->goodsClick(1);
	}
	
	private function strCode($str){
		return "<b>{$str}</b>";
	}
	
	public function info(){
		echo '----------------------------------------------</br>';
		echo 'model->select($what,$where,$order,$limit)</br>';
		echo '$what => 查询的内容(查询所有内容为  "*")</br>';
		echo '$where => 查询依据(一般为 id=？,classid=？)</br>';
		echo '$order => 排序(一般为 goods_click des,goods_click)</br>';
		echo '$limit => 查询多少个(写数字)</br>';
		echo '$order,$limit 可以省略</br>';
		echo '----------------------------------------------</br>';
	}
	
	public function articles_model(){
		$str = $this->strCode('$this->articles_model->select("*","1=1","id","3");');
		echo $str.'</br><pre>';
		print_r(
			$this->articles_model->select('*','id=1','id','1')
			);
		$str = $this->strCode('$this->articles_model->search("*","1=1",id","3");');
		echo $str.'</br>';
		print_r($this->articles_model->search("*",'1=1','id','4'));
		echo '</pre>=====================================================================</br>';
	}
	
	public function category_model(){
		$str = $this->strCode('$this->category_model->select("*","1=1","id")');
		echo $str.'<pre>';
		print_r($this->category_model->select("*","1=1","classid"));
		echo '</pre>=====================================================================</br>';
	}
	

	
}


?>